<template>
  <!-- 借出 -->
  <j-modal
    :title="title"
    :width="width"
    :visible="visible"
    switchFullscreen
    @ok="handleOk"
    :confirmLoading="confirmLoading"
    :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }"
    @cancel="handleCancel"
    cancelText="关闭"
  >
    <sk-tool-lend-form ref="SkToolLendForm" @modelLoading="getConfirmLoading" @ok="submitCallback" :disabled="disableSubmit"></sk-tool-lend-form>
  </j-modal>
</template>
<script>
import SkToolLendForm from "./SkToolLendForm.vue";
export default {
  name: 'SkCirculateModel',
  data() {
    return {
      title: '借出',
      width: 600,
      visible: false,
      disableSubmit: false,
      confirmLoading:false,
    }
  },
  components: {
    SkToolLendForm
  },

  filters: {},

  computed: {},

  created() {
  },

  activated() {},

  mounted() {},

  methods: {
    getConfirmLoading(data){
      this.confirmLoading = data;
    },
    // 借出id为主列表id
    add(record, flag) {
      this.visible = true
      this.$nextTick(()=>{
        this.$refs.SkToolLendForm.add(record, flag)
      })
    },
    
    close() {
      this.visible = false
    },
    handleOk() {
      this.$refs.SkToolLendForm.handleOk();
    },
    submitCallback() {
      this.$emit('ok')
      this.visible = false
    },
    handleCancel() {
      this.close()
    }
  }
}
</script>
<style scoped>
/* @import url(); 引入css类 */
</style>
